﻿(function () {
    var googleStock = {
        stockCode: "",
        period: ""
    };  //頁面參數 初始化

    $(document).ready(function () {       
        $(".historical_price tr").each(function () {
            if (!this.rowIndex) return; // skip first row
            var date = this.cells[0].innerHTML;
            var open = this.cells[1].innerHTML;
            var high = this.cells[2].innerHTML;
            var low = this.cells[3].innerHTML;
            var close = this.cells[4].innerHTML;
            var volume = this.cells[5].innerHTML;

            $.WuDada.DataLoadService.CreateStockData({
                stockCode: gGoogleStock.stockCode,
                period: gGoogleStock.period,
                dataTime: date,
                openValue: open,
                highValue: high,
                lowValue: low,
                closeValue: close,
                volumeValue: volume
            }, function (postData) {
            });
        });

        //window.close();
    }); // $(document).ready 

    window.gGoogleStock = googleStock;

})(window);

